package znbkChangeNote.api;

import com.example.lancooznbk.service.HttpPostServer;
import com.lancoo.rxretrofitlibrary.Api.BaseApi;
import com.lancoo.rxretrofitlibrary.listener.HttpOnNextListener;
import com.trello.rxlifecycle.components.support.RxAppCompatActivity;
import com.trello.rxlifecycle.components.support.RxFragment;

import retrofit2.Retrofit;
import rx.Observable;
import znbkChangeNote.entity.SaveNoteEntity;

/**
 * Created by Administrator on 2018\3\14 0014.
 */

public class SaveNoteApi extends BaseApi {

    private SaveNoteEntity mSaveNoteEntity;

    public SaveNoteEntity getmSaveNoteEntity() {
        return mSaveNoteEntity;
    }

    public void setmSaveNoteEntity(SaveNoteEntity mSaveNoteEntity) {
        this.mSaveNoteEntity = mSaveNoteEntity;
    }


    public SaveNoteApi(HttpOnNextListener listener, RxAppCompatActivity rxAppCompatActivity) {
        super(listener, rxAppCompatActivity);
    }

    public SaveNoteApi(HttpOnNextListener listener, RxFragment rxFragment) {
        super(listener, rxFragment);
    }

    @Override
    public Observable getObservable(Retrofit retrofit) {
        HttpPostServer httpPostServer = retrofit.create(HttpPostServer.class);

        return httpPostServer.savePersonalNote(mSaveNoteEntity);
    }
}
